<script type="text/javascript">
var deletePath = "<?php echo CController::createUrl('user/removefavorite')?>";
function removeFavorite(obj,id){
	$(obj).parent().remove();
	window.path1=deletePath+"/id/"+id;
	$.ajax({
		url:deletePath+"/id/"+id
	});
}
</script>
<!-- Start of first page -->
<div data-role="page">
	<div data-role="header" data-theme="b">
		<a href="#" data-icon="back" onclick="history.go(-1);">返回</a>
		<h1>
			<?php if(UserIdentity::getUserDetail(Yii::app()->user->id)->nickname==null):?>
				<?php echo Yii::app()->user->name?>的搜藏
			<?php else:?>
				<?php echo UserIdentity::getUserDetail(Yii::app()->user->id)->nickname?>的搜藏
			<?php endif?>
		</h1>
	</div>
	<!-- /header -->
	<?php $this->renderPartial("//site/toolbar")?>
	<!-- /footer -->
	
	<div data-role="content">
	<ul data-role="listview" data-split-icon="delete" data-split-theme="d">
	<?php foreach ($favorites as $favorite):?>
		<li><a rel='external' href="<?php echo Yii::app()->createUrl('bbs/view', array('id'=>$favorite->favorite_id,'page'=>$favorite->page)); ?> ">
			<h4><?php echo $favorite->title;?></h4>
			</a>
			<a onclick='removeFavorite(this,<?php echo $favorite->id?>)'></a>
		</li>
	<?php endforeach;?>
	</ul>
	</div>
	<?php $this->renderPartial("//site/footer")?>
	<!-- /footer -->
</div>
<!-- /page -->